import request from '@/utils/request'
const group_name='gathering'
const api_name='gathering'
export default{
    getList(){
        return request({
          url:`/${api_name}`,
            method:'get'
        });
    },

    search(page,size,searchMap){
        return request({
          url: `/${api_name}/search/${page}/${size}`,//ES6写法
            method: 'post',
            data: searchMap
        });
    },

    save(pojo){
        return request({
          url: `${api_name}`,
            method: 'post',
            data: pojo
        })
    },

    findById(id){
        return request({
          url: `${api_name}/${id}`,
            method: 'get'
        })
    },

    update(id,pojo){
        if(id == null || id == ''){
            return this.save(pojo)
        }
        return request({
          url: `${api_name}/${id}`,
            method: 'put',
            data: pojo
        })
    },

    deleteById(id){
        return request({
          url: `${api_name}/${id}`,
            method:'delete'
        })
    }
}
